#!/usr/bin/env bash

set -euo pipefail

prepare () {
  sudo mkdir -p $1

  # sudo chown -R dark:dark $1
  # note: we updated from the above to the below because of some symlinked
  #   tree-sitter binary in the tsd/node_modules dir

  sudo find "$1" ! -type l -exec chown dark:dark {} +
}

prepare "backend/Build"
prepare "/home/dark/.nuget"
prepare "tree-sitter-darklang/build"
prepare "tree-sitter-darklang/node_modules"
